import React from 'react';
import { View, ToastAndroid } from 'react-native';
import FormInput from '../components/inputs/FormInput';
import InputClearable from '../components/inputs/InputClearable';
import DictInput from '../components/inputs/DictInput';

class Inputs extends React.Component {

    static navigationOptions = {
        drawerLabel: '表单控件'
    }

    state = {
        val1: '',
        xb: {}
    }

    render() {
        const { val1, xb } = this.state;

        return (
            <View style={{ alignItems: 'center', flex: 1 }}>
                <View style={{ width: '100%' }}>
                    <InputClearable
                        clear
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />
                    <FormInput
                        require
                        label="姓名"
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />
                    <FormInput
                        label="姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />
                    <FormInput
                        label="性别"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                        onPress={() => {
                            ToastAndroid.show('sss', ToastAndroid.SHORT);
                        }}
                    />
                    <DictInput
                        label="性别"
                        onChangeText={v => this.setState({ xb: v })}
                        value={xb}
                    />
                    {/* <FormInput
                        label="姓名"
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />

                    <FormInput
                        clear
                        label="姓名"
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />

                    <FormInput
                        clear
                        require
                        label="姓名"
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />

                    <ListInput
                        clear
                        first
                        label="姓名"
                        placeholder="请输入姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />

                    <ListInput
                        clear
                        require
                        label="姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                    />

                    <ListInput
                        clear
                        require
                        label="姓名"
                        refInput={ipt => this.ipt = ipt}
                        onChangeText={v => this.setState({ val1: v })}
                        value={val1}
                        onPress={() => {
                            ToastAndroid.show('success', ToastAndroid.SHORT);
                        }}
                    /> */}
                </View>
            </View>
        );
    }
}

export default Inputs;